package itheima.lianxi4;

import java.util.ArrayList;

public class Test2 {
    public static void main(String[] args) {
        ArrayList<Movie> list = new ArrayList<>();
        Movie m1 = new Movie("唐山大地震","冯小刚","灾难");
        Movie m2 = new Movie("羞羞的铁拳","宋阳","喜剧");
        Movie m3 = new Movie("集结号","冯小刚","历史");

        list.add(m1);
        list.add(m2);
        list.add(m3);

        for (int i = 0; i < list.size(); i++) {
            Movie mov = list.get(i);
            if (mov.getDirector().equals("冯小刚")){
                System.out.println(mov.getTitle() + "-" + mov.getDirector() + "-" + mov.getType());
            }
        }
    }
}
